package com.jinunn.system.converter;


import com.jinunn.system.entity.User;
import com.jinunn.system.model.params.UserParam;
import com.jinunn.system.model.vo.user.UserInfoVO;
import org.mapstruct.InheritInverseConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

/**
 * 用户对象转换器
 *
 * @author Jindun
 * @version UserConverter.java, v0.1 2024年 07⽉ 10⽇  下午5:08 Jindun Exp $
 */
@Mapper(componentModel = "spring")
public interface UserConverter {

    @InheritInverseConfiguration(name = "convertToForm")
    User convertToEntity(UserParam entity);


    @Mappings({
            @Mapping(target = "userId", source = "id")
    })
    UserInfoVO toUserInfoVo(User entity);

}
